package kr.co.insoft.publicmesh;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Publicmesh 메인 페이지
 */
@Controller
public class HomeController {

	private static final Logger logger = LoggerFactory
			.getLogger(HomeController.class);

	/**
	 * Publicmesh 메인 페이지
	 * 
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/", method = RequestMethod.GET)
	public String home() throws Exception {
		Authentication auth = SecurityContextHolder.getContext()
				.getAuthentication();
		logger.info("User Authorities {}", auth.getAuthorities());

		return "tiles/home";
	}
}
